<template>
  <div>
    <header class="header">
      <h1>任务列表</h1>
      <input
        @keyup.enter="add"
        v-model="todoData"
        class="new-todo"
        placeholder="请输入要做的事情"
        autofocus
      />
    </header>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {},
  data() {
    return {
      todoData: "",
    };
  },
  watch: {},
  computed: {},
  methods: {
    add() {
      this.$emit("add", this.todoData);
      this.todoData = "";
    },
  },
  created() {},
  mounted() {},
};
</script>
<style scoped lang="less"></style>
